home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Patches / 3.3Patch.ImprovedDNS.post_install next >
Text File  |  1996-04-17  |  1KB  |  66 lines

  1. #!/bin/sh
  2. # 3.3Intel68kPatch.post_install
  3. # 3.3HPPASPARCPatch.post_install
  4. # This script will remove the comment (and blank) lines from the
  5. # /private/etc/hosts and /usr/template/client/etc/hosts files so
  6. # that the YP routines don't go wild. This is needed if you want
  7. # the new lookupd / DNS behavior.
  8. #
  9. # Allan Nathanson, NeXT Computer, 27 September 1995
  10.  
  11. #
  12. # Files to be updated.
  13. #
  14. HOSTS1="/private/etc/hosts"
  15. HOSTS2="/usr/template/client/etc/hosts"
  16.  
  17. #
  18. # Check that any files which must exist are actually present.
  19. #
  20. for f in ${HOSTS1} ${HOSTS2}
  21. do
  22.     if [ ! -f ${f} ]; then
  23.         echo "FAILED (The original file, ${f}, does not exist)"
  24.         exit 1
  25.     fi
  26. done
  27.  
  28. #
  29. # Make the Installer.app log look nice!
  30. #
  31. echo ""
  32.  
  33. #
  34. # Save copies of files which are present before package installation.
  35. #
  36. for f in ${HOSTS1} ${HOSTS2}
  37. do
  38.     if [ -f ${f}.NS33 ]; then
  39.         echo "        Original version of ${f} already exists."
  40.     else
  41.         /bin/echo -n "        Saving original version of ${f} ... "
  42.         /bin/cp -p ${f} ${f}.NS33
  43.         echo "OK."
  44.     fi
  45. done
  46.  
  47. #
  48. # Remove comments and blank lines from the flat "hosts" files.
  49. #
  50. for f in ${HOSTS1} ${HOSTS2}
  51. do
  52.     echo -n "        Updating ${f} ... "
  53.     /bin/cp ${f} /tmp/hosts.$$
  54.     /bin/sed -e '/^#/d' -e '/^$/d' /tmp/hosts.$$ > ${f}
  55.     /bin/rm -f /tmp/hosts.$$
  56.     echo "OK."
  57. done
  58.  
  59. #
  60. # Make the package installation log look nice!
  61. #
  62. echo "    ... done."
  63.  
  64. exit 0
  65.